package com.yunshang.shoppingmall.mapper;

import com.yunshang.shoppingmall.entity.UserNo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserNoMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(UserNo record);

    int insertSelective(UserNo record);

    UserNo selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(UserNo record);

    int updateOpenid(UserNo record);

    int updateByPrimaryKey(UserNo record);

    UserNo selectUserNoByUserNo(@Param("userNo") String userNo);

    UserNo selectUserNoByOpenid(@Param("openid") String openid);

    //根据用户ID查询用户编号
    List<UserNo> selectUserNoByUserId(@Param("userId") int userId);
    //List<UserNo> selectUserNoByUserIdList(@Param("userId") int userId);
    //更新用户密码
    int updatePwdByUserNo(UserNo userNo);


    //根据推荐人查询所有的下级用户
    List<UserNo> selectAllNextUserNoByRecommend(@Param("userNoId") int userNoId);

    //活动排行榜
    List<UserNo> ActivityList(@Param("guige") int guige);

    //活动总数
    int ActivitySum(@Param("guige") int guige);

    //会员销售量
    int ActivityUserNoSum(@Param("uid") int uid,@Param("guige") int guige);

    //活动排行榜
    List<UserNo> WActivityList();

    //活动总数
    int WActivitySum();

    //会员销售量
    int WActivityUserNoSum(@Param("uid") int uid);

    //查询所有用户编号
    List<UserNo> selectUserNoList();

    int selectUserNoCount();

    UserNo selectUserInfo(@Param("userId") int userId);

    List<UserNo> selectRecommendListByUserNoId(UserNo userNo);

    List<UserNo> selectUserListByUserNoOrName(UserNo userNo);

    //查询所有用户编号,ID
    List<UserNo> selectUserNoListUserNo();
}